package com.gxaedu.dly2022.pojo;

import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 用户信息表(User)实体类
 *
 * @author makejava
 * @since 2022-01-19 19:41:18
 * @version 1.0
 */
@ApiModel(value = "User",description = "用户信息表")
public class User implements Serializable {
    private static final long serialVersionUID = 478132502619547173L;
    /**
    * 主键
    */
	@ApiModelProperty(name = "id",notes = "主键",dataType = "Integer",required = true)
    private Integer id;
    /**
    * 用户名称
    */
	@ApiModelProperty(name = "username",notes = "用户名称",dataType = "String",required = true)
    private String username;
    /**
    * 密码
    */
	@ApiModelProperty(name = "password",notes = "密码",dataType = "String",required = true)
    private String password;
    /**
    * 年龄
    */
	@ApiModelProperty(name = "age",notes = "年龄",dataType = "Integer",required = true)
    private Integer age;
    /**
    * 生日
    */
	@ApiModelProperty(name = "birth",notes = "生日",dataType = "Date",required = true)
    private Date birth;
    /**
    * 部门的外键
    */
	@ApiModelProperty(name = "departmentId",notes = "部门的外键",dataType = "Integer",required = true)
    private Integer departmentId;
    /**
    * 权限的外键
    */
	@ApiModelProperty(name = "roleId",notes = "权限的外键",dataType = "Integer",required = true)
    private Integer roleId;
    /**
    * 最后登录时间
    */
	@ApiModelProperty(name = "lastLogi  nTime",notes = "最后登录时间",dataType = "Date",required = true)
    //接收字符串日期，转换为data对象，前端必须传递"2020-06-20 01:01:01" 这样的格式
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//前端必须传输的格式
    //下面是服务器响应返回的内容，如果格式没有转换，那么返回的内容是长毫秒数，接收mysql数据库中的数据也需要设置东八区+8时
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date lastLoginTime;//java自己传输Data对象即可
private Role role;
private Department department;

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
        
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
        
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
        
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
        
    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }
        
    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }
        
    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }
        
    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

}